<template>
  <div class="menu">
    菜单
  </div>
</template>

<script>
import { getAllMenu, deleteMenu } from '@/services/menu'

export default {
  name: 'MenuIndex',

  data () {
    return {
      menus: []
    }
  },
  created () {
    this.loadAllMenu()
  },
  methods: {
    loadAllMenu () {
      console.log('getAllMenu', getAllMenu)
    },
    handleEdit (index, row) {
      console.log('edit', index, row)
      this.$router.push({
        name: 'menu-edit',
        params: {
          id: row.id
        }
      })
    },
    handleDelete (index, row) {
      console.log('delete', index, row)
      this.$confirm('确认删除吗？', '删除提示', {})
        .then(async () => { // 确认执行
          // 删除
          console.log('deleteMenu', deleteMenu)
        })
        .catch(() => { // 取消执行
          this.$message.info('已取消删除')
        })
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
